package com.baidu.structure.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * Created by sunmo on 2016/11/29.
 */
public class ThreadPoolUtils {
    private static ExecutorService executor;

    //init
    public static void init(int n){
        executor=Executors.newFixedThreadPool(n);
    }

    //execute
    public static void execute(Runnable task){
        executor.execute(task);
    }
}
